/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SubmitQuestion.java
 *
 * Created on Dec 19, 2011, 11:06:27 PM
 */
package nuce.form;

import java.sql.SQLException;
import java.util.Random;
import java.util.Vector;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import nuce.entity.Question;
/**
 *
 * @author Master
 */
public class SubmitQuestion extends javax.swing.JFrame {

    private Vector u;
    Random rd=new Random();
    public SubmitQuestion() {
        initComponents();
        u = new Vector();
        this.anquyen();
        this.loadcombo();
        this.radiobutton();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtquestion = new javax.swing.JTextArea();
        txta = new javax.swing.JTextField();
        txtb = new javax.swing.JTextField();
        txtc = new javax.swing.JTextField();
        txtd = new javax.swing.JTextField();
        btnsubmit = new javax.swing.JButton();
        btnclear = new javax.swing.JButton();
        btnexit = new javax.swing.JButton();
        lblquestion = new javax.swing.JLabel();
        lbla = new javax.swing.JLabel();
        lblb = new javax.swing.JLabel();
        lblc = new javax.swing.JLabel();
        lbld = new javax.swing.JLabel();
        lblleve = new javax.swing.JLabel();
        lbllevelb = new javax.swing.JLabel();
        lbllevela = new javax.swing.JLabel();
        lbllevec = new javax.swing.JLabel();
        btndelete = new javax.swing.JButton();
        btnedit = new javax.swing.JButton();
        lblshearch = new javax.swing.JLabel();
        cmbtimkiem = new javax.swing.JComboBox();
        radiolevela = new javax.swing.JRadioButton();
        radiolevelb = new javax.swing.JRadioButton();
        radiolevelc = new javax.swing.JRadioButton();
        btnsheatch = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        txtquestion.setColumns(20);
        txtquestion.setRows(5);
        jScrollPane1.setViewportView(txtquestion);

        btnsubmit.setBackground(new java.awt.Color(255, 255, 255));
        btnsubmit.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        btnsubmit.setText("Submit");
        btnsubmit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsubmitActionPerformed(evt);
            }
        });

        btnclear.setBackground(new java.awt.Color(255, 255, 255));
        btnclear.setFont(new java.awt.Font("Tahoma", 0, 14));
        btnclear.setText("Clear");
        btnclear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnclearActionPerformed(evt);
            }
        });

        btnexit.setBackground(new java.awt.Color(255, 255, 255));
        btnexit.setFont(new java.awt.Font("Tahoma", 0, 14));
        btnexit.setText("Exit");
        btnexit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnexitActionPerformed(evt);
            }
        });

        lblquestion.setFont(new java.awt.Font("Tahoma", 0, 14));
        lblquestion.setText("Question");

        lbla.setFont(new java.awt.Font("Tahoma", 0, 14));
        lbla.setText("A.(True)");

        lblb.setFont(new java.awt.Font("Tahoma", 0, 14));
        lblb.setText("B.(False)");

        lblc.setFont(new java.awt.Font("Tahoma", 0, 14));
        lblc.setText("C.(False)");

        lbld.setFont(new java.awt.Font("Tahoma", 0, 14));
        lbld.setText("D.(False)");

        lblleve.setFont(new java.awt.Font("Tahoma", 0, 14));
        lblleve.setText("Level");

        lbllevelb.setText("Level b(Question 6-10)");

        lbllevela.setText("Level a(Question 1-5)");

        lbllevec.setText("Level c(Question 11-15)");

        btndelete.setBackground(new java.awt.Color(255, 255, 255));
        btndelete.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        btndelete.setText("Delete");
        btndelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btndeleteActionPerformed(evt);
            }
        });

        btnedit.setBackground(new java.awt.Color(255, 255, 255));
        btnedit.setFont(new java.awt.Font("Tahoma", 0, 14));
        btnedit.setText("Edit");
        btnedit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btneditActionPerformed(evt);
            }
        });

        lblshearch.setFont(new java.awt.Font("Tahoma", 0, 14));
        lblshearch.setText("Shearch Question");

        radiolevela.setBackground(new java.awt.Color(255, 255, 255));
        radiolevela.setFont(new java.awt.Font("Tahoma", 0, 12));
        radiolevela.setText("Level a");

        radiolevelb.setBackground(new java.awt.Color(255, 255, 255));
        radiolevelb.setFont(new java.awt.Font("Tahoma", 0, 12));
        radiolevelb.setText("Level b");

        radiolevelc.setBackground(new java.awt.Color(255, 255, 255));
        radiolevelc.setFont(new java.awt.Font("Tahoma", 0, 12));
        radiolevelc.setText("Level c");

        btnsheatch.setText("Shearch");
        btnsheatch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsheatchActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblshearch)
                .addGap(97, 97, 97)
                .addComponent(cmbtimkiem, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(27, 27, 27)
                .addComponent(btnsheatch)
                .addContainerGap(146, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(109, 109, 109)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(radiolevela)
                            .addComponent(lbllevela))
                        .addGap(93, 93, 93))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnsubmit)
                        .addGap(91, 91, 91)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(107, 107, 107)
                        .addComponent(btnexit, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(160, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbllevelb)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(9, 9, 9)
                                .addComponent(radiolevelb)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbllevec)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addComponent(radiolevelc)))
                        .addGap(95, 95, 95))))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(226, 226, 226)
                .addComponent(btnedit, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(114, 114, 114)
                .addComponent(btndelete)
                .addContainerGap(245, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addComponent(lblquestion)
                        .addGap(25, 25, 25)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbla)
                            .addComponent(lblb)
                            .addComponent(lblleve))
                        .addGap(29, 29, 29)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txta, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtb, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 114, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblc)
                            .addComponent(lbld))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txtc, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE))))
                .addGap(78, 78, 78))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblshearch)
                            .addComponent(cmbtimkiem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(54, 54, 54)
                                .addComponent(lblquestion))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(42, 42, 42)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblleve)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(radiolevela)
                                        .addComponent(radiolevelb)))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbllevela)
                                    .addComponent(lbllevelb)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(radiolevelc)
                                .addGap(18, 18, 18)
                                .addComponent(lbllevec)))
                        .addGap(19, 19, 19)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbla))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblb)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblc))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbld))))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(19, 19, 19)
                                        .addComponent(btnclear))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addComponent(btnexit)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnedit)
                                    .addComponent(btndelete)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(btnsubmit))))
                    .addComponent(btnsheatch))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public void radiobutton()
    {
        ButtonGroup btg=new ButtonGroup();
        btg.add(radiolevela);
        btg.add(radiolevelb);
        btg.add(radiolevelc);
    }
    public void anquyen() {
        lblshearch.setVisible(false);
        cmbtimkiem.setVisible(false);
        btnedit.setVisible(false);
        btndelete.setVisible(false);
        btnsheatch.setVisible(false);
    }

    public void hienquyen() {
        lblshearch.setVisible(true);
        cmbtimkiem.setVisible(true);
        btnedit.setVisible(true);
        btndelete.setVisible(true);
        btnsheatch.setVisible(true);
    }

    public void loadcombo() {
        try {
            cmbtimkiem.removeAllItems();
            Question qs = new Question();
            u = qs.getquestion();
            for (int i = 0; i < u.size(); i++) {
                String s = ((Question) u.get(i)).getContent();
                cmbtimkiem.addItem(s);
            }
        } catch (SQLException sql) {
            System.out.println(sql.getMessage());
        }
    }

    public void loadtext() {
        try {
            Question qs = new Question();
            u = qs.BinQuestion(cmbtimkiem.getSelectedItem().toString());
            for (int i = 0; i < u.size(); i++) 
            {
                txtquestion.setText(((Question) u.get(i)).getContent());
                txta.setText(((Question) u.get(i)).getAnswer1());
                txtb.setText(((Question) u.get(i)).getAnswer2());
                txtc.setText(((Question) u.get(i)).getAnswer3());
                txtd.setText(((Question) u.get(i)).getAnswer4());

                if (((Question) u.get(i)).getLevel() <= 5) {
                    radiolevela.setSelected(true);
                }
                else if (((Question) u.get(i)).getLevel()<=10 || ((Question) u.get(i)).getLevel()>5) {
                    radiolevelb.setSelected(true);
                }
                else if(((Question) u.get(i)).getLevel()>10){
                    radiolevelc.setSelected(true);
                }
            }
        } catch (SQLException sql) {
            System.out.println(sql.getMessage());
        }
    }
        private void btnexitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnexitActionPerformed
            // TODO add your handling code here:
            this.dispose();
    }//GEN-LAST:event_btnexitActionPerformed

    private void btnclearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnclearActionPerformed
        // TODO add your handling code here:
        txtquestion.setText("");
        txta.setText("");
        txtb.setText("");
        txtc.setText("");
        txtd.setText("");
    }//GEN-LAST:event_btnclearActionPerformed

    private void btnsubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsubmitActionPerformed
        // TODO add your handling code here:
        Question qs = new Question();
        qs.setContent(txtquestion.getText());
        qs.setAnswer1(txta.getText());
        qs.setAnswer2(txtb.getText());
        qs.setAnswer3(txtc.getText());
        qs.setAnswer4(txtd.getText());
        if(radiolevela.isSelected()==true)
        {
            qs.setLevel(1+rd.nextInt(4));
        }
        if(radiolevelb.isSelected()==true)
        {
            qs.setLevel(6+rd.nextInt(4));
        }
        if(radiolevelc.isSelected()==true)
        {
            qs.setLevel(11+rd.nextInt(4));
        }
        int t = 0;
        try {
            t = qs.insertQuestion(qs);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        if (t == 1) {
            JOptionPane.showMessageDialog(this, "Add successful", "Infofrm", JOptionPane.INFORMATION_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(this, "Add erro!");
        }
    }//GEN-LAST:event_btnsubmitActionPerformed

    private void btneditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneditActionPerformed
        // TODO add your handling code here:
        Question qs = new Question();
        qs.setContent(txtquestion.getText());
        qs.setAnswer1(txta.getText());
        qs.setAnswer2(txtb.getText());
        qs.setAnswer3(txtc.getText());
        qs.setAnswer4(txtd.getText());
        if(radiolevela.isSelected()==true)
        {
            qs.setLevel(1+rd.nextInt(4));
        }
        if(radiolevelb.isSelected()==true)
        {
            qs.setLevel(6+rd.nextInt(4));
        }
        if(radiolevelc.isSelected()==true)
        {
            qs.setLevel(11+rd.nextInt(4));
        }
        int t = 0;
        try {
            t = qs.EditQuestion(qs);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        if (t == 1) {
            JOptionPane.showMessageDialog(this, "Update successful", "Infofrm", JOptionPane.INFORMATION_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(this, "Update erro!!!");
        }  
    }//GEN-LAST:event_btneditActionPerformed

    private void btnsheatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsheatchActionPerformed
        // TODO add your handling code here:
        this.loadtext();
    }//GEN-LAST:event_btnsheatchActionPerformed

    private void btndeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btndeleteActionPerformed
        // TODO add your handling code here:
        try {
        int show = JOptionPane.showConfirmDialog(this, "Are You sure delete ?", "Inform", JOptionPane.YES_NO_OPTION);
        int t = 0, count = 0;
        Question qs=new Question();
        if (show == JOptionPane.YES_OPTION) {
            try {
                    t = qs.DeleteQuestion(cmbtimkiem.getSelectedItem().toString());
                    if (t == 1) {
                        count++;
                    }
                if (count > 0) {
                    JOptionPane.showMessageDialog(this, "Deleted " + count + " record ", "successful.", JOptionPane.INFORMATION_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "Error", "Inform", JOptionPane.ERROR_MESSAGE);
                }
            } catch (SQLException x) {
                System.out.println(x);
            }
            this.loadcombo();
        }
    } catch (Exception e) {
        System.out.println("Select Question!!!");
    }
    }//GEN-LAST:event_btndeleteActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(SubmitQuestion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(SubmitQuestion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(SubmitQuestion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SubmitQuestion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new SubmitQuestion().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnclear;
    private javax.swing.JButton btndelete;
    private javax.swing.JButton btnedit;
    private javax.swing.JButton btnexit;
    private javax.swing.JButton btnsheatch;
    private javax.swing.JButton btnsubmit;
    private javax.swing.JComboBox cmbtimkiem;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbla;
    private javax.swing.JLabel lblb;
    private javax.swing.JLabel lblc;
    private javax.swing.JLabel lbld;
    private javax.swing.JLabel lblleve;
    private javax.swing.JLabel lbllevec;
    private javax.swing.JLabel lbllevela;
    private javax.swing.JLabel lbllevelb;
    private javax.swing.JLabel lblquestion;
    private javax.swing.JLabel lblshearch;
    private javax.swing.JRadioButton radiolevela;
    private javax.swing.JRadioButton radiolevelb;
    private javax.swing.JRadioButton radiolevelc;
    private javax.swing.JTextField txta;
    private javax.swing.JTextField txtb;
    private javax.swing.JTextField txtc;
    private javax.swing.JTextField txtd;
    private javax.swing.JTextArea txtquestion;
    // End of variables declaration//GEN-END:variables

}
